package com.bwie.bwedu.fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import com.bwie.bwedu.R;
import com.bwie.bwedu.ui.CheckSwitchButton;

/**
 * Created by Administrator on 2016/7/21.
 * 新消息设置
 */
public class MessageSettingFragment extends BaseFragment {

    private View view;
    private CheckSwitchButton message1;
    private CheckSwitchButton message2;

    @Override
    public View getView(LayoutInflater inflater) {
        view = inflater.inflate(R.layout.fragment_message,null);
        return view;
    }

    @Override
    public void findView() {
        message1 = (CheckSwitchButton) view.findViewById(R.id.message1);
        message2 = (CheckSwitchButton) view.findViewById(R.id.message2);
    }

    @Override
    public void setData() {

    }

    @Override
    public void setListener() {
        message1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
                if(isChecked){
                    //选中

                    Toast.makeText(getActivity(),"接收推送消息",Toast.LENGTH_LONG).show();
                }else{
                    //未选中
                    Toast.makeText(getActivity(),"不接收推送消息",Toast.LENGTH_LONG).show();
                }
            }
        });// 添加监听事件
        message2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
                if(isChecked){
                    //选中

                    Toast.makeText(getActivity(),"接收到期提醒",Toast.LENGTH_LONG).show();
                }else{
                    //未选中
                    Toast.makeText(getActivity(),"不接收到期提醒",Toast.LENGTH_LONG).show();
                }
            }
        });// 添加监听事件
    }
}
